<%-- 
    Document   : index
    Created on : 23 лип 2012, 21:12:23
    Author     : Volodymyr Lavrynovych <volodya.lavrynovych@gmail.com>
--%>

<%@page import="mygang.controller.WizardHandler"%>
<%@page import="mygang.controller.AbstractController"%>
<%@page import="org.springframework.security.core.authority.SimpleGrantedAuthority"%>
<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="mygang.helper.ApplicationContentHelper"%>
<%@page import="mygang.helper.Consts"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="mg" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<% ApplicationContentHelper helper = new ApplicationContentHelper(request);%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <mg:import file="bootstrap.css"/>
        <mg:import file="bootstrap-responsive.css"/>
        <mg:import file="jquery.js"/>
        <mg:import file="jquery-ui-1.8.22.custom.min.js"/>
        <mg:import file="jquery-ui-1.8.22.custom.css"/>
        <mg:import file="notifier.js"/>
        <mg:import file="helper.js"/>
        <mg:import file="date.js"/>
        <mg:import file="jquery.validate.min.js"/>
        <mg:import file="jquery.metadata.js"/>
        <mg:import file="dialogManager.js"/>
        <script>dialogManager.init('<mg:baseurl/>');</script>
        <%=helper.getConstructor()%>
        <script>
            Wizard.url.save = dialogManager.getBaseUrl() + '<%=AbstractController.WIZARD_HANDLER+WizardHandler.WIZARD_SAVE%>';
            Wizard.url.get = dialogManager.getBaseUrl() + '<%=AbstractController.WIZARD_HANDLER+WizardHandler.WIZARD_GET%>';
        </script>
        
        <title><sitemesh:write property='title'/></title>
        <sitemesh:write property='head'/>
        
        <script>
            
            
            $(document).ready(function(){
                window.sessionCountdown = null;
                reloadMenu();
            });
            
            function reloadMenu(){
                $('#main-menu #user-submenu').load('<mg:url value="views/undecored/user_submenu.jsp"/>', function(){
                    console.log('USER submenu items were loaded...')
                })
            }
        </script>
    </head>
    <body>
        <!-- Menu ========================================================== -->
        <div id="main-menu" class="navbar navbar-fixed-top navbar-inverse">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="<mg:baseurl/>">My Gang</a>

                    <div class="nav-collapse in collapse" style="height: auto;">
                        <ul class="nav">
                            <li class="active"><a href="<mg:baseurl/>">Home</a></li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Management <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li class="nav-header">Wizards</li>
                                    <li><a href="<mg:url value="manager/element/"/>">Manage Elements</a></li>
                                    <li><a href="<mg:url value="manager/template/"/>">Manage Templates</a></li>
                                    <li><a href="<mg:url value="manager/table/"/>">Manage Tables</a></li>
                                    <li><a href="<mg:url value="manager/entity/"/>">Manage Entities</a></li>
                                    <li><a href="<mg:url value="manager/field/"/>">Manage Fields</a></li>
                                    <li><a href="<mg:url value="manager/wizard/"/>">Manage Wizards</a></li>
                                    <li class="divider"></li>
                                    <li class="nav-header">Users</li>
                                    <li><a href="<mg:url value="manager/user/"/>">Manage Users</a></li>
                                    <li><a href="<mg:url value="manager/role/"/>">Manage Roles</a></li>
                                    <li class="nav-header">Security</li>
                                    <li><a href="#" style="color: red;">Manage Rights</a></li>
                                    <li class="nav-header">Other</li>
                                    <li><a href="<mg:url value="manager/batch/"/>">Manage News</a></li>
                                    <li><a href="<mg:url value="manager/setting/"/>">Manage Settings</a></li>
                                </ul>
                            </li>
                        </ul>
                        <ul class="nav pull-right">
                            <li class="dropdown" id="user-submenu"></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
                            
        <!-- Content ======================================================= -->
        <div class="container-fluid" style="padding-top: 60px;">
            <!-- Content =================================================== -->
            <div class="row-fluid">
                <div class="span12 page-content-container">
                    <sitemesh:write property='body'/>
                </div>
            </div>
        
            <!-- Footer ==================================================== -->
            <hr/>
            <footer class="container-fluid" id="footer">
                 <div class="row-fluid">
                    <div class="span6" id="statistic">
                        <b>&copy; Volodymyr Lavrynovych 2012</b><br />
                        Application version: ${appVersion}<br />
                        Users/Guests: ${userNumber}/${guestNumber}
                    </div>
                    <blockquote class="span6" id="blockquote"></blockquote>
                </div>
            </footer>
        </div>
        
        <mg:import file="bootstrap.js"/>
        <mg:import file="forismatic.js"/>
        
    </body>
</html>
